#TODO
# run with PL only
# read displacements
# apply them to the perfect model
# run axial loads
#
# in the study class create methods to manage this runs among different models
# one for perfect... disturb the other with the displacements from the first 
# etc
#       
# think about running artificially dumped analysis because the models the local buckling is hiding the overall buckling behaviour
# 
# Michal
# we need the first deepness of the dimple as a quantification of the first 
# imperfection
#
# FIXME 3D graphics for membrane forces

import laminate_parameters
laminate_parameters = reload( laminate_parameters )
angles = [90,-30, 30,-45, 45,-60, 60,0]
for num_plies in [5]:
    fam = laminate_parameters.LamFamily()
    fam.num_plies = num_plies
    fam.angles = angles
    fam.rebuild()
    fam.create_family( balanced=False,
                       use_iterator=True )
    fam.rebuild_params()
    fam.plot( keys=['a1','a3','d1','d3'], savefig=False, fit_plots=False )    
    #fam.save(r'c:\temp\%s.pickle' % fam.name)
#import matplotlib.pylab as pylab
#a1  = fam.params[ 'a1' ]
#fa3 = a1.functions[ 'a3' ]
#fig = pylab.figure()
#sub = fig.add_subplot(1,1,1)
#sub.scatter( fa3.x, fa3.y )
#fa3.calc_ymins_ymaxs()
#sub.plot( fa3.xfit, fa3.ymins )
#sub.plot( fa3.xfit, fa3.ymaxs )
#fig.show()

